<script language="javascript" type="text/javascript"> 
function GetDateStr(AddDayCount) 
{ 
	alert(typeof AddDayCount)
	var dd = new Date(); 
	dd.setFullYear(2015,08,21)
	// msg ="2007/10/01";
	// msg = msg.split("/");
	// console.log(msg[0]);
	// console.log(msg[1]);
	// console.log(msg[2]);
	//alert(dd.getMonth()) 
	//var dd = "2015-08-21"; 
	dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期 
	var y = dd.getFullYear(); 
	var m = (dd.getMonth())<10?"0"+(dd.getMonth()):(dd.getMonth());//获取当前月份的日期，不足10补0
	var d = dd.getDate()<10?"0"+dd.getDate():dd.getDate(); //获取当前几号，不足10补0
	return y+"-"+m+"-"+d; 
}
document.write("日期：1992,11,3"); 
document.write("半年前："+GetDateStr(-180)); 
document.write("<br />三月前："+GetDateStr(-90)); 
document.write("<br />一月前："+GetDateStr(-30)); 
document.write("<br />昨天："+GetDateStr(-1)); 
document.write("<br />今天："+GetDateStr(0)); 
document.write("<br />明天："+GetDateStr(1)); 
document.write("<br />后天："+GetDateStr(2)); 
document.write("<br />一月后："+GetDateStr(30));
document.write("<br />三月后："+GetDateStr(90));
document.write("<br />半年后："+GetDateStr(180)); 
</script> 